package se.miun.dt156g.antonsskafferibestallning;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity implements OnClickListener{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		Button lunchTableButton = (Button)findViewById(R.id.orderLunchButton);
		Button dinnerTableButton = (Button)findViewById(R.id.orderDinnerButton);
		Button getOrderButton = (Button)findViewById(R.id.getOrderButton);
		lunchTableButton.setOnClickListener(this);
		dinnerTableButton.setOnClickListener(this);
		getOrderButton.setOnClickListener(this);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.orderLunchButton:
			Intent startLunchTableActivity = new Intent(this, LunchTableActivity.class);
			startActivity(startLunchTableActivity);
			Log.d("KLICK", "Lunch");
			break;
		
		case R.id.orderDinnerButton:
			Intent startDinnerTableActivity = new Intent(this, DinnerTableActivity.class);
			startActivity(startDinnerTableActivity);
			Log.d("KLICK", "Middag");
			break;
		
		case R.id.getOrderButton:
			Intent startGetOrderActivity = new Intent(this, GetOrderActivity.class);
			startActivity(startGetOrderActivity);
			Log.d("KLICK", "Hämta beställning");
			break;
		default:
			break;
		}
		
	}

}
